package com.party.core.dao.read.mall;

import com.party.core.dao.read.BaseReadDao;
import com.party.core.model.mall.MallCategory;
import com.party.core.model.mall.MallCategoryOutput;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 商城商品类型数据读取
 * Created by wei.li
 *
 * @date 2017/8/15 0015
 * @time 16:04
 */
@Repository
public interface MallCategoryReadDao extends BaseReadDao<MallCategory> {
    List<MallCategory> selectCategory();

    List<MallCategory> getByParentId(@Param(value = "parentId") String parentId);

    /**
     * 根据商品id获取已分配的分类
     *
     * @param goodsId 商品id
     * @return
     */
    List<MallCategory> getGoodsCategory(@Param(value = "goodsId") String goodsId);

    List<MallCategory> findByName(@Param("name") String name, @Param("parentId") String parentId);

    List<MallCategoryOutput> getAll();
}
